package cn.bytets.rpc.api.close;

import java.util.ArrayList;
import java.util.List;

public class RpcCloseHookRegister {

    private List<Closes> list = new ArrayList<Closes>(16);

    private RpcCloseHookRegister(){}

    public static RpcCloseHookRegister getInstance(){
        return HookRegisterInstance.getInstance();
    }

    public List<Closes> getList(){
        return list;
    }
    public Closes addCloseHook(Closes closes){
        list.add(closes);
        return closes;
    }
    public void clear(){
        list.clear();;
    }
    private static class HookRegisterInstance{

        private final static RpcCloseHookRegister instance = new RpcCloseHookRegister();

        private static RpcCloseHookRegister getInstance(){
            return instance;
        }
    }
}
